<template>
<onekit-page>
<onekit-view onekit-class="container">
	<div is="onekit-template-head" :DATA="`${JSON.stringify({title:'camera'})}`"></div>
	<onekit-view onekit-class="page-body">
		<onekit-view onekit-class="page-body-wrapper">
			<onekit-camera mode="scanCode" flash="off" @Scancode="scanCode" @Error="error"></onekit-camera>
			<onekit-view onekit-class="btn-area">
				<onekit-button type="primary" @Tap="navigateBack">返回正常模式</onekit-button>
			</onekit-view>
			<onekit-form>
				<onekit-view onekit-class="page-section">
					<onekit-view onekit-class="weui-cells weui-cells_after-title">
						<onekit-view onekit-class="weui-cell weui-cell_input">
							<onekit-view onekit-class="weui-cell__hd">
								<onekit-view onekit-class="weui-label">类型</onekit-view>
							</onekit-view>
							<onekit-view onekit-class="weui-cell__bd">{{ result.type }}</onekit-view>
						</onekit-view>
						<onekit-view onekit-class="weui-cell weui-cell_input">
							<onekit-view onekit-class="weui-cell__hd">
								<onekit-view onekit-class="weui-label">结果</onekit-view>
							</onekit-view>
							<onekit-view onekit-class="weui-cell__bd">{{ result.result }}</onekit-view>
						</onekit-view>
					</onekit-view>
				</onekit-view>
			</onekit-form>
		</onekit-view>
	</onekit-view>
	<div is="onekit-template-foot"></div>
</onekit-view>
</onekit-page></template>
<script>
/* eslint-disable */
import Vue from 'vue';
import onekit_template_0 from '../../../../page/common/head.head.vue';Vue.component('onekit-template-head',onekit_template_0);
import onekit_template_1 from '../../../../page/common/foot.foot.vue';Vue.component('onekit-template-foot',onekit_template_1);
const ONEKIT_JSON= {
  "navigationBarTitleText": "camera",
  "usingComponents": {
    
  }
};
const ONEKIT_SJS = {
};
import wx from '../../../../../weixin2vue/wx.js';
import Macro from '../../../../../weixin2vue/Macro.js';
const {getApp,getCurrentPages} = Macro;
import Page from '../../../../../weixin2vue/OnekitPage.js';
import Component from '../../../../../weixin2vue/OnekitComponent.js';
export default Page(ONEKIT_JSON,["result","type"],ONEKIT_SJS,{
    "onShareAppMessage"(){
      return {
        "title":'camera',
        "path":'page/component/pages/camera-scan-code/camera-scan-code'
};
    },
    "data":{
        "result":{
}
},
    "onReady"(){
      wx.showModal({
        "title":'提示',
        "content":'将摄像头对准一维码即可扫描',
        "showCancel":false
});
    },
    "scanCode"(e){
      console.log('scanCode:',e);
      this.setData({
        "result":e.detail
});
    },
    "navigateBack"(){
      wx.navigateBack();
    },
    "error"(e){
      console.log(e.detail);
    }
});

</script>
<style 
 lang="css">
@import '/page/common/lib/weui.css';
.onekit-camera {
  height: 250px ;
}
.btn-area {
  margin-top: 0 ;
}
.onekit-form {
  margin-top: 15px ;
}
.weui-cell__bd {
  display: flex ;
  justify-content: flex-start ;
  align-items: center ;
  padding: 10px 0 ;
  min-height: 30px ;
}
</style>